package com.decorate.controller;

import com.decorate.Vos.DesignTeamReqVo;
import com.decorate.Vos.ProductReqVo;
import com.decorate.Vos.*;
import com.decorate.service.DesignProductionService;
import com.decorate.service.DesignerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/decorate")
@Api(value = "翰洁装饰")
public class DecorateController {

    @Autowired
    public DesignProductionService productionService;

    @Autowired
    public DesignerService designerService;

    @ApiOperation("设计团队中具体设计师")
    @GetMapping("/designer/team/{id}")
    public R<DesignerVo> designer(@PathVariable("id") Integer id){return designerService.designer(id);}

    @ApiOperation("设计团队(含条件查询)")
    @PostMapping("/designer/team")
    public R<List<DesignTeamVo>> designTeams(@RequestParam DesignTeamReqVo designTeamReqVo){
        return designerService.designTeams(designTeamReqVo);
    }

    @ApiOperation("设计师中设计作品")
    @GetMapping("/designer/product/{id}")
    public R<List<DesignProductVo>> designProducts(@PathVariable("id") Integer id){
        return productionService.designProducts(id);
    }

    @ApiOperation("精品案例(含条件查询)")
    @PostMapping("/product")
    public R<List<DesignProductVo>> getProducts(@RequestParam ProductReqVo productReqVo){
        return productionService.getProducts(productReqVo);
    }

    @ApiOperation("精品案例中具体作品")
    @GetMapping("/product/{id}")
    public R<ProductVo> getProduct(@PathVariable("id") Integer id){
        return productionService.getProduct(id);
    }
}
